#include <iostream>

using namespace std;

const int N = 1e6 + 10;

int q[N];
int n;
int sum;

int main(void)
{
    cin >> n;
    for (int i = 0; i < n; i++)
        scanf("%d", &q[i]);

    int i = 0, j = 1;
    while (j <= n)
    {
        if (j == n || q[j - 1] == q[j])
        {
            sum = sum > j - i ? sum : j - i;
            i = j;
        }
        j++;
    }

    cout << sum << endl;
}